<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/

Route::get('/', function()
{
	return Redirect::to('RondomSystem/showLogin');
});

Route::group(['prefix'=>'RondomSystem'],function()
{
	//登陆页面
	Route::get('showLogin','LoginController@showView');
	//登陆检测
	Route::post('LoginCheck','LoginController@receiveValue');
	
	//注册页面
	Route::get('showRegister','RegisterController@showView');
	//注册用户
	Route::post('Register','RegisterController@receiveValue');

	//展示反馈信息页面
	Route::get('showFeedback','FeedBackController@showView');
	//反馈信息控制
	Route::post('feedBack','FeedBackController@feedBack');
	
	//登陆拦截器
	Route::group(['before'=>'auth'],function()
	{

		//拦截非管理员权限不能进行一下操作
		Route::group(['before'=>'isAdmin'],function()
		{
			//管理员引导页面
			Route::get('showAdminIndex','AdminController@showIndex');


			//用户管理页
			Route::get('userManage','AdminController@userList');

			//用户管理模块
			Route::group(['prefix'=>'userManage'],function()
			{
				//用户信息
				Route::get('userInfo','AdminController@userInfo');
				//生成序列号
				Route::get('createServerNumber','AdminController@createServerNumber');
				//发送序列号到用户
				Route::post('sendServerInfo','AdminController@sendServerInfo');	
			});
			
		});

		//激活页面
		Route::get('showUserActivation','UserController@showActivation');
		//激活用户
		Route::post('activation','UserController@activation');
		//拦截没有激活的用户不能登陆系统
		Route::group(['before'=>'isActivation'],function()
		{
			//用户引导页面
			Route::get('showUserIndex','UserController@showIndex');
		});

		
	});
});
